//
//  BuyLotteryViewModel.m
//  MoXiProject
//
//  Created by 沈晨宇 on 2017/7/12.
//  Copyright © 2017年 周筱雯. All rights reserved.
//

#import "BuyLotteryViewModel.h"

@implementation BuyLotteryViewModel

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        
    }
    return self;
}
/*
  收藏
 */
-(RACSignal *)BuyLotteryParameter:(NSString* )userId type:(NSString* )type commonNum:(NSString* )commonNum specialNum:(NSString* )specialNum qihao:(NSString* )qihao{

    return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
        
        NSDictionary *param = @{@"userId" :userId,
                                @"type" :type,
                                @"commonNum"  :commonNum,
                                @"specialNum"  :specialNum,
                                @"qihao"  :qihao
                                };
        
        [ScyRequestOperationManager buyLotteryParametersDic:param success:^(NSDictionary *result) {
            
            NSLog(@"收藏：%@",result);
            
            [subscriber sendNext:result];
            [subscriber sendCompleted];
            
        } failture:^(id result) {
            
           
            [subscriber sendError:result];
            
        }];
        
        return nil;

    }];
            
}

/*
  期号
 */
-(RACSignal *)LotteryBuyNumParameter:(NSString* )type{

    
    return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
        
        NSDictionary *param = @{
                                @"type" :type
                                };
        
        [ScyRequestOperationManager LotteryBuyNumParametersDic:param success:^(NSDictionary *result) {
            
            NSLog(@"期号：%@",result);
            
            [subscriber sendNext:result];
            [subscriber sendCompleted];
            
        } failture:^(id result) {
            
            
            [subscriber sendError:result];
            
        }];
        
        return nil;
        
    }];

}
@end
